<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /fasttmp/mkdist-qt-4.3.5-1211793125/qtopia-core-opensource-src-4.3.5/src/qt3support/widgets/q3whatsthis.cpp -->
<head>
  <title>Qt 4.3: Q3WhatsThis Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">Q3WhatsThis Class Reference<br /><sup><sup>[<a href="qt3support.html">Qt3Support</a> module]</sup></sup></h1>
<pre> #include &lt;Q3WhatsThis&gt;</pre><p><b>This class is part of the Qt 3 support library.</b> It is provided to keep old source code working. We strongly advise against using it in new code. See <a href="porting4.html#qwhatsthis">Porting to Qt 4</a> for more information.</p>
<p>Inherits <a href="qobject.html">QObject</a>.</p>
<ul>
<li><a href="q3whatsthis-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h3>Public Functions</h3>
<ul>
<li><div class="fn"/><b><a href="q3whatsthis.html#Q3WhatsThis">Q3WhatsThis</a></b> ( QWidget * <i>widget</i> )</li>
<li><div class="fn"/><b><a href="q3whatsthis.html#dtor.Q3WhatsThis">~Q3WhatsThis</a></b> ()</li>
<li><div class="fn"/>virtual bool <b><a href="q3whatsthis.html#clicked">clicked</a></b> ( const QString &amp; <i>href</i> )</li>
<li><div class="fn"/>virtual QString <b><a href="q3whatsthis.html#text">text</a></b> ( const QPoint &amp; <i>pos</i> )</li>
</ul>
<ul>
<li><div class="fn"/>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
</ul>
<a name="static-public-members"></a>
<h3>Static Public Members</h3>
<ul>
<li><div class="fn"/>void <b><a href="q3whatsthis.html#add">add</a></b> ( QWidget * <i>widget</i>, const QString &amp; <i>text</i> )</li>
<li><div class="fn"/>void <b><a href="q3whatsthis.html#display">display</a></b> ( const QString &amp; <i>text</i>, const QPoint &amp; <i>pos</i> = QCursor::pos(), QWidget * <i>widget</i> = 0 )</li>
<li><div class="fn"/>void <b><a href="q3whatsthis.html#enterWhatsThisMode">enterWhatsThisMode</a></b> ()</li>
<li><div class="fn"/>bool <b><a href="q3whatsthis.html#inWhatsThisMode">inWhatsThisMode</a></b> ()</li>
<li><div class="fn"/>void <b><a href="q3whatsthis.html#leaveWhatsThisMode">leaveWhatsThisMode</a></b> ( const QString &amp; <i>text</i> = QString(), const QPoint &amp; <i>pos</i> = QCursor::pos(), QWidget * <i>widget</i> = 0 )</li>
<li><div class="fn"/>void <b><a href="q3whatsthis.html#remove">remove</a></b> ( QWidget * <i>widget</i> )</li>
<li><div class="fn"/>QToolButton * <b><a href="q3whatsthis.html#whatsThisButton">whatsThisButton</a></b> ( QWidget * <i>parent</i> )</li>
</ul>
<ul>
<li><div class="fn"/>5 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"/>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
<li><div class="fn"/>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
<li><div class="fn"/>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
<li><div class="fn"/>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="Q3WhatsThis"></a>Q3WhatsThis::Q3WhatsThis ( <a href="qwidget.html">QWidget</a> * <i>widget</i> )</h3>
<p>Constructs a new &quot;What's This?&quot; object for <i>widget</i>.</p>
<h3 class="fn"><a name="dtor.Q3WhatsThis"></a>Q3WhatsThis::~Q3WhatsThis ()</h3>
<p>Destroys the &quot;What's This?&quot; object.</p>
<h3 class="fn"><a name="add"></a>void Q3WhatsThis::add ( <a href="qwidget.html">QWidget</a> * <i>widget</i>, const <a href="qstring.html">QString</a> &amp; <i>text</i> )&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>Adds <i>text</i> as &quot;What's This?&quot; help for <i>widget</i>. If the text is rich text formatted (i.e&#x2e; it contains markup) it will be rendered with the default stylesheet QStyleSheet::defaultSheet().</p>
<p>The text is destroyed if the widget is later destroyed, so it need not be explicitly removed.</p>
<p>See also <a href="q3whatsthis.html#remove">remove</a>().</p>
<h3 class="fn"><a name="clicked"></a>bool Q3WhatsThis::clicked ( const <a href="qstring.html">QString</a> &amp; <i>href</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>This virtual function is called when the user clicks inside the &quot;What's this?&quot; window. <i>href</i> is the link the user clicked on, or an empty string if there was no link.</p>
<p>If the function returns true (the default), the &quot;What's this?&quot; window is closed, otherwise it remains visible.</p>
<p>The default implementation ignores <i>href</i> and returns true.</p>
<h3 class="fn"><a name="display"></a>void Q3WhatsThis::display ( const <a href="qstring.html">QString</a> &amp; <i>text</i>, const <a href="qpoint.html">QPoint</a> &amp; <i>pos</i> = QCursor::pos(), <a href="qwidget.html">QWidget</a> * <i>widget</i> = 0 )&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>Display <i>text</i> in a help window at the global screen position <i>pos</i>.</p>
<p>If widget <i>widget</i> is not 0 and has its own dedicated <a href="qwhatsthis.html">QWhatsThis</a> object, this object will receive <a href="q3whatsthis.html#clicked">clicked</a>() messages when the user clicks on hyperlinks inside the help text.</p>
<p>See also <a href="q3whatsthis.html#clicked">clicked</a>().</p>
<h3 class="fn"><a name="enterWhatsThisMode"></a>void Q3WhatsThis::enterWhatsThisMode ()&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>Enters &quot;What's This?&quot; mode and returns immediately.</p>
<p>Qt will install a special cursor and take over mouse input until the user clicks somewhere. It then shows any help available and ends &quot;What's This?&quot; mode. Finally, Qt removes the special cursor and help window and then restores ordinary event processing, at which point the left mouse button is no longer pressed.</p>
<p>The user can also use the Esc key to leave &quot;What's This?&quot; mode.</p>
<p>See also <a href="q3whatsthis.html#inWhatsThisMode">inWhatsThisMode</a>() and <a href="q3whatsthis.html#leaveWhatsThisMode">leaveWhatsThisMode</a>().</p>
<h3 class="fn"><a name="inWhatsThisMode"></a>bool Q3WhatsThis::inWhatsThisMode ()&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>Returns true if the application is in &quot;What's This?&quot; mode; otherwise returns false.</p>
<p>See also <a href="q3whatsthis.html#enterWhatsThisMode">enterWhatsThisMode</a>() and <a href="q3whatsthis.html#leaveWhatsThisMode">leaveWhatsThisMode</a>().</p>
<h3 class="fn"><a name="leaveWhatsThisMode"></a>void Q3WhatsThis::leaveWhatsThisMode ( const <a href="qstring.html">QString</a> &amp; <i>text</i> = QString(), const <a href="qpoint.html">QPoint</a> &amp; <i>pos</i> = QCursor::pos(), <a href="qwidget.html">QWidget</a> * <i>widget</i> = 0 )&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>This function is used internally by widgets that support QWidget::customWhatsThis(); applications do not usually call it. An example of such a widget is <a href="q3popupmenu.html">Q3PopupMenu</a>: menus still work normally in &quot;What's This?&quot; mode but also provide help texts for individual menu items.</p>
<p>If <i>text</i> is not empty, a &quot;What's This?&quot; help window is displayed at the global screen position <i>pos</i>. If widget <i>widget</i> is not 0 and has its own dedicated <a href="qwhatsthis.html">QWhatsThis</a> object, this object will receive <a href="q3whatsthis.html#clicked">clicked</a>() messages when the user clicks on hyperlinks inside the help text.</p>
<p>See also <a href="q3whatsthis.html#inWhatsThisMode">inWhatsThisMode</a>(), <a href="q3whatsthis.html#enterWhatsThisMode">enterWhatsThisMode</a>(), and <a href="q3whatsthis.html#clicked">clicked</a>().</p>
<h3 class="fn"><a name="remove"></a>void Q3WhatsThis::remove ( <a href="qwidget.html">QWidget</a> * <i>widget</i> )&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>Removes the &quot;What's This?&quot; help associated with the <i>widget</i>. This happens automatically if the widget is destroyed.</p>
<p>See also <a href="q3whatsthis.html#add">add</a>().</p>
<h3 class="fn"><a name="text"></a><a href="qstring.html">QString</a> Q3WhatsThis::text ( const <a href="qpoint.html">QPoint</a> &amp; <i>pos</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>This virtual function returns the text for position <i>pos</i> in the widget that this &quot;What's This?&quot; object documents. If there is no &quot;What's This?&quot; text for the position, an empty string is returned.</p>
<p>The default implementation returns an empty string.</p>
<h3 class="fn"><a name="whatsThisButton"></a><a href="qtoolbutton.html">QToolButton</a> * Q3WhatsThis::whatsThisButton ( <a href="qwidget.html">QWidget</a> * <i>parent</i> )&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>Creates a <a href="qtoolbutton.html">QToolButton</a> preconfigured to enter &quot;What's This?&quot; mode when clicked. You will often use this with a tool bar as <i>parent</i>:</p>
<pre> (void)QWhatsThis::whatsThisButton( my_help_tool_bar );</pre>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2008 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.3.5</div></td>
</tr></table></div></address></body>
</html>
